chore(piltover): align with new ProgramInfo enum + plumb katana_tee_config_hash - #73
Merged
Merged
Conversation
…e_config_hash` (#72) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ployed address The cherry-pick of #72 onto `main` aligned Saya's Rust code with the new `ProgramInfo` enum, but the e2e settlement test still deploys the OLD Piltover Cairo class (vendored at `contracts/core_contract.json`, generated from the pre-enum-split `piltover` submodule). Result: cainome reads `get_program_info()` as the new enum shape but the on-chain contract returns the old 4-felt struct, surfaced as "Index not handle for enum ProgramInfo". Bump the `piltover` submodule from `37e487f` to `ebb714b` (cartridge-gg/piltover#feat/tee-persistent merge head, includes #16's enum split). Rebuild `contracts/core_contract.json` via `scarb build` in the submodule. The new Sierra class hash is `0x38a8e7e81744f89ae85d64c036101c124c19b4e6844c6d73f922f03d89487e6` (was `0x...`), so the UDC-derived deployed address changes too. Computed via `starknet::core::utils::get_contract_address(salt=0x0, class_hash, calldata=[katana0_addr, 0, Felt::MAX, 0], deployer=0x0)`: old: 0x387f8d08b19b4f0b3809a3411eab4a27f804ad672a37faeab77bd99af2b9896 new: 0x5f8c60f1c40b63452d3b5cb39669d35b37ec57d0761ad12ecdadd00c3d90102 Update all 8 hardcoded references across `compose.{yml,e2e.yml,l2.yml,l3.yml}` including the `sn_msg` deploy calldata (it takes the Piltover address). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…_HASH
The previous commit's submodule + class regen + compose-address bump was
correct, but the e2e compose stack was still pulling pre-built saya images
from ghcr (`ghcr.io/dojoengine/saya:{v0.2.2,feat-tee,latest}`) — those
images embed the OLD `core_contract.json` with the OLD class hash.
So `core_contract_declare` declared the NEW class on chain (from this PR's
embedded bytes — except the bytes inside the ghcr container are still OLD,
declaring the OLD class), `core_contract_deploy` defaulted to the OLD
`DEFAULT_PILTOVER_CLASS_HASH` and deployed at the OLD address `0x387f8d08…`,
but `core_contract_setup` was pointed at the NEW address `0x5f8c60f1…` which
doesn't exist on chain. Result: "Requested contract address … is not
deployed".
Fix: switch all four compose files to `build: { context: ., dockerfile:
Dockerfile }` so the saya container is built fresh from this PR's source.
The fresh-built `saya-ops` binary embeds the regenerated `core_contract.json`
and the new `DEFAULT_PILTOVER_CLASS_HASH`, so declare → deploy → setup all
land on the same NEW class.
`DEFAULT_PILTOVER_CLASS_HASH` constant updated to
`0x38a8e7e81744f89ae85d64c036101c124c19b4e6844c6d73f922f03d89487e6`
(class hash of the regenerated `contracts/core_contract.json`). The old
class hash was load-bearing for already-deployed Piltovers on Sepolia/
Mainnet — operators on those networks now need to pass `--class-hash`
explicitly. Comment in `constants.rs` updated to reflect this.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kariy
added a commit
to dojoengine/katana
that referenced
this pull request
Apr 29, 2026
saya@feat/tee@0072383 pins `cartridge-gg/katana-tee.git` via `ssh://git@github.com/...` URLs in `bin/persistent-tee/Cargo.toml`. CI doesn't have an SSH deploy key loaded for that repo, so `cargo install --path bin/persistent-tee` fails to clone the dep. `cartridge-gg/katana-tee` is public, so we can fetch it anonymously over HTTPS. Add `git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"` before the cargo install steps so cargo fetch resolves SSH URLs as HTTPS. (saya@main uses HTTPS URLs directly per dojoengine/saya#73; this workaround is only needed while the saya rev is on `feat/tee`.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #72 onto
main. Aligns Saya withcartridge-gg/piltover#feat/tee-persistent'sProgramInfoenum split and threads the newkatana_tee_config_hashfield from the Katana RPC response through the TEE pipeline into the on-chainTEEInput.Why
Piltover now identifies the appchain via two distinct variants:
Each deployment commits to one variant;
validate_inputpanics on cross-mode submission. For the TEE path,validate_inputalso assertstee_input.katana_tee_config_hash == KatanaTeeProgramInfo.katana_tee_config_hash, so Saya needs to source that exact value (the one Katana attested) and pass it through.Changes
cartridge-gg/piltover#feat/tee-persistent. Single source of truth across root +bin/persistent+bin/persistent-tee.649f0864to pick upcartridge-gg/katana-tee#1which surfaceskatana_tee_config_hashonTeeQuoteResponse.bin/ops/src/core_contract/utils.rs::set_program_infoprependsFelt::ZERO(theStarknetOsvariant index) to the calldata.opsstays ZK-only.saya/core::TeeAttestation/TeeProofgainkatana_tee_config_hash: Felt.bin/persistent-tee/src/{attestor,prover,settlement}.rsplumb the field: attestor lifts it off the RPC response, prover threads it through both theTeeQuoteResponseround-trip (in the non-mock branch onmain) andTeeProof, settlement passes it toTEEInput.katana_tee_config_hash.tests/e2e/tests/settlement.rsmatches theStarknetOsvariant before reading the four hash fields.Differences vs PR #72
The cherry-pick had three conflicts that resolved trivially:
bin/persistent-tee/Cargo.toml— main useshttps://URLs (vsfeat/tee'sssh://); kept main's URL style with the new rev.bin/persistent-tee/src/prover.rs— main has amock_provebranch thatfeat/teedidn't; the new field goes on the existingTeeQuoteResponseinside the non-mock else-branch.bin/persistent-tee/Cargo.lock— taken from main and re-resolved against the new piltover/katana-tee deps; aws-* family stays pinned to main's working versions.Cross-repo
cartridge-gg/piltovercartridge-gg/katana-teedojoengine/sayadojoengine/sayadojoengine/katanaTest plan
cargo check --workspacecleancd bin/persistent-tee && cargo checkcleanbin/persistent(local SNOS Python venv issue)tests/e2e/tests/settlement.rs::test_program_info_and_fact_registrypasses after the variant match updatesaya-tee-e2epass (already green on katana #556 against the same ABI)🤖 Generated with Claude Code